namespace DotNetNuke.Security.Authentication
{
    using DotNetNuke.Entities.Portals;
    using DotNetNuke.Framework;
    using System;
    using System.Collections;

    public abstract class AuthenticationProvider
    {
        private static AuthenticationProvider objProvider = null;

        /// -------------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [tamttt]	08/01/2004	Created
        /// </history>
        /// -------------------------------------------------------------------
        static AuthenticationProvider()
        {
            PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
            Configuration _config = Configuration.GetConfig();
            string strKey = "AuthenticationProvider" + _portalSettings.PortalId.ToString();
            objProvider = (AuthenticationProvider) Reflection.CreateObject(_config.ProviderTypeName, strKey);
        }

        public abstract Array GetAuthenticationTypes();
        public abstract ArrayList GetGroups();
        public abstract string GetNetworkStatus();
        public abstract UserInfo GetUser(string LoggedOnUserName);
        public abstract UserInfo GetUser(string LoggedOnUserName, string LoggedOnPassword);
        /// -------------------------------------------------------------------
        /// <summary>
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// [tamttt]	08/01/2004	Created
        /// </history>
        /// -------------------------------------------------------------------
        public static AuthenticationProvider Instance(string AuthenticationTypeName)
        {
            PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
            string strKey = "AuthenticationProvider" + _portalSettings.PortalId.ToString();
            objProvider = (AuthenticationProvider) Reflection.CreateObject(AuthenticationTypeName, strKey);
            return objProvider;
        }

        public abstract bool IsAuthenticationMember(GroupInfo AuthenticationGroup, UserInfo AuthenticationUser);
    }
}

